#!/usr/bin/env python
    ##########################################################################
    ##(c) 2008 Bastian Damman                                               ##
    ##                                                                      ##
    ##This file is part of Kaboom-O-rama.                                   ##
    ##                                                                      ##
    ##Kaboom-O-rama is free software: you can redistribute it and/or modify ##
    ##it under the terms of the GNU General Public License as published by  ##
    ##the Free Software Foundation, either version 3 of the License, or     ##
    ##(at your option) any later version.                                   ##
    ##                                                                      ##
    ##Kaboom-O-rama is distributed in the hope that it will be useful,      ##
    ##but WITHOUT ANY WARRANTY; without even the implied warranty of        ##
    ##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         ##
    ##GNU General Public License for more details.                          ##
    ##                                                                      ##
    ##You should have received a copy of the GNU General Public License     ##
    ##along with Kaboom-O-rama.  If not, see <http://www.gnu.org/licenses/>.##
    ##########################################################################

from pygame import *

class TerminalFunctions:
    def __init__(self, main):
        self.main = main
        
    def t_exit(self):
        quit()
        exit()
    
    #--------GRID--------#
    def grid_set_width(self, arg1):
        return self.main.grid.change_width(arg1)        
    def grid_set_height(self, arg1):
        return self.main.grid.change_height(arg1)
    def grid_add_xcells(self, arg1):
        return self.main.grid.change_width(
            self.grid_get_width() + self.grid_get_cel_size() * arg1)
    def grid_add_ycells(self, arg1):
        return self.main.grid.change_height(
            self.grid_get_height() + self.grid_get_cel_size() * arg1)
    def grid_get_width(self):
        return self.main.grid.get_width()
    def grid_get_height(self):
        return self.main.grid.get_height()
    def grid_get_cel_size(self):
        return self.main.grid.cel_size
    
    
    #--------TOOL--------#
    def tool_set_tool(self, arg1):
        return self.main.tool.set_tool(arg1)
    def tool_get_flags(self):
        return self.main.tool.get_tool_flags(self.main.tool.current_tool)
    def tool_set_flag(self, arg1, arg2):
        flags = self.main.tool.get_tool_flags(self.main.tool.current_tool)
        print arg1, arg2
        flags[arg1] = arg2
        
    